package com.cm.controller;

import com.cm.behavior.strategy.example2.Hotel;
import com.cm.behavior.strategy.example2.Strategy;
import com.cm.behavior.strategy.example2.StrategyContext;
import com.cm.behavior.strategy.example2.Waimai;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gcm
 * @date 2024/5/22 15:10
 */
@RestController
@RequestMapping("test")
public class TestController {
    @GetMapping("strategy")
    public void test(){
        String rewardType = "Hotel";
        //测试单例加载
        Hotel.getInstance();
        Waimai.getInstance();
        Strategy strategy = StrategyContext.getStrategy(rewardType);
        strategy.issue("");
    }
}
